Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typing][B-49] Add type annotations for python/paddle/base/layer_helper.py #66639

Merged
merged 3 commits into from
Aug 4, 2024

Conversation

ooooo-create
Copy link
Contributor

@ooooo-create ooooo-create commented Jul 26, 2024

PR Category

User Experience

PR Types

Improvements

Description

类型标注:
- python/paddle/base/layer_helper.py

Related links

@SigureMo @megemini

Copy link

paddle-bot bot commented Jul 26, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Jul 26, 2024
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Jul 27, 2024
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好像又是没有公开 API 的文件

python/paddle/base/param_attr.py Outdated Show resolved Hide resolved
python/paddle/base/layer_helper.py Outdated Show resolved Hide resolved
python/paddle/base/layer_helper.py Outdated Show resolved Hide resolved
inputs = self.multiple_input(input_param_name)
if len(inputs) != 1:
raise f"{self.layer_type} layer only takes one input"
return inputs[0]

@property
def param_attr(self):
def param_attr(self) -> ParamAttrLike | list[ParamAttrLike]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用的 ParamAttrLike 是不是都应该是 ParamAttr

Copy link
Contributor Author

@ooooo-create ooooo-create Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,已修改~

python/paddle/base/layer_helper.py Outdated Show resolved Hide resolved
inputs = self.multiple_input(input_param_name)
if len(inputs) != 1:
raise f"{self.layer_type} layer only takes one input"
return inputs[0]

@property
def param_attr(self):
def param_attr(self) -> ParamAttr | list[ParamAttr]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是按理说只会有一个?应该不会出现 list?bias 同

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@SigureMo SigureMo merged commit d143935 into PaddlePaddle:develop Aug 4, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants